<template>
  <view :style="themeColor">
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center relinquishRecord_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub relinquishRecord_fd0_0'>
          <view class='flex flex-wrap align-center relinquishRecord_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  relinquishRecord_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='relinquishRecord_fd0_0_c1_c0'>捐农具记录</text>
          </view>
          <view class='flex flex-wrap align-center justify-end relinquishRecord_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
        <template v-for='(item,key0) in recordsList'>
          <view class='flex flex-direction flex-wrap align-stretch relinquishRecord_fd1_0' :key='key0'>
            <view class='flex flex-wrap align-center'>
              <text class='relinquishRecord_fd1_0_c0_c0'>{{item.name}}</text>
              <text class='relinquishRecord_fd1_0_c0_c1' v-if=" item.pid=='3'">大型农具</text><text
                class='relinquishRecord_fd1_0_c0_c1_1' v-if=" item.pid=='2'">中型农具</text><text
                class='relinquishRecord_fd1_0_c0_c1_2' v-if=" item.pid=='1'">小型农具</text>
              <text class='relinquishRecord_fd1_0_c0_c2'>送积分</text>
            </view>
            <view class='flex flex-wrap align-center justify-between relinquishRecord_fd1_0_c1'>
              <text class='relinquishRecord_fd1_0_c1_c0'>{{item.create_time}}</text>
              <view class='flex flex-wrap align-center'>
                <text class='relinquishRecord_fd1_0_c1_c1_c0'>+</text>
                <text class='relinquishRecord_fd1_0_c1_c1_c0'>{{item.bonus_points || 0}}</text>
              </view>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->


    </view>
  </view>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "recordsList": [],
        "user": {
          "follow_count": "",
          "invite_code": "",
          "address": "",
          "address_code": "",
          "address_citycode": "",
          "id": "",
          "lastid": "",
          "user_nickname": "",
          "mobile": "",
          "user_name": "",
          "head_img": "",
          "birthday": "",
          "is_finger": "",
          "user_money": "",
          "freeze_money": "",
          "withdrawal_money": "",
          "score": "",
          "empirical": "",
          "invoice_title": "",
          "invoice_company_title": "",
          "total_consumption_money": "",
          "sex": "",
          "create_time": "",
          "phone": "",
          "online": "",
          "_mobile": "",
          "coupon": "",
          "age": "",
          "collection_count": "",
          "browse_count": "",
          "certified": "",
          "invite": [],
          "is_member": "",
          "expirationTime": "",
          "userlevel_id": "",
          "vip_last_time": ""
        }
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },
      userInfo: {
        get() {
          return this.$store.state.userInfo
        },
        set() {
          this.$store.commit('updateUserInfo', value)
        },
      },
      isLogin() {
        return this.$store.state.token == '' ? false : true;
      }
    },
    watch: {},
    onLoad(options) {
      this.getfarmListFunc()
      this.getUserFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {
      this.getfarmListFunc()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //获取农具记录
      getfarmListFunc() {
        this.minixPagingListsApi = global.apiUrls.post62b9118254ebf;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          goods_type: '1',
          user_id: this.userInfo ?  this.userInfo.id : ''
        }
        this.listData = [];
        this.recordsList = this.listData;
        this.pagingListToggle();
      },
      //获取会员信息
      async getUserFunc() {
        //请求方法
        //数据验证

        let datauser = await this.$api.post(global.apiUrls.post5c78c4772da97, {

        });

        if (datauser.data.code != 1) {
          this.$message.info(datauser.data.msg);
          return
        }
        let infouser = datauser.data;
        this.user = infouser.data
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor0);
    background-size: 100% auto;
  }

  .relinquishRecord_flex_0 {
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
  }

  .relinquishRecord_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333;
    line-height: 88rpx;
  }

  .relinquishRecord_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .relinquishRecord_fd0_0_c0 {
    width: 120rpx;
  }

  .relinquishRecord_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .relinquishRecord_fd1_0_c1_c1_c0 {
    color: rgba(230, 56, 56, 1);
    font-size: 36rpx;
    font-weight: 700;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .relinquishRecord_fd1_0_c1_c0 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
  }

  .relinquishRecord_fd1_0_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .relinquishRecord_fd1_0_c0_c2 {
    color: #999999;
    font-size: 24rpx;
    font-weight: 400;
    margin: 0rpx 0rpx 0rpx auto;
  }

  .relinquishRecord_fd1_0_c0_c1_2 {
    background: rgba(230, 143, 56, 0.1);
    color: rgba(230, 143, 56, 1);
    font-size: 20rpx;
    font-weight: 400;
    padding: 2rpx 8rpx 2rpx 8rpx;
    border-radius: 4rpx;
    background-size: 100% auto;
  }

  .relinquishRecord_fd1_0_c0_c1_1 {
    background: rgba(56, 103, 230, 0.1);
    color: rgba(56, 103, 230, 1);
    font-size: 20rpx;
    font-weight: 400;
    padding: 2rpx 8rpx 2rpx 8rpx;
    border-radius: 4rpx;
    background-size: 100% auto;
  }

  .relinquishRecord_fd1_0_c0_c1 {
    background: rgba(230, 56, 56, 0.1);
    color: #E63838;
    font-size: 20rpx;
    font-weight: 400;
    padding: 2rpx 8rpx 2rpx 8rpx;
    border-radius: 4rpx;
    background-size: 100% auto;
  }

  .relinquishRecord_fd1_0_c0_c0 {
    color: #333333;
    font-size: 28rpx;
    font-weight: 500;
    margin: 0rpx 12rpx 0rpx 0rpx;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    max-width: 400rpx;
  }

  .relinquishRecord_fd1_0 {
    background: #FFFFFF;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    margin: 24rpx 24rpx 0rpx 24rpx;
    padding: 32rpx 24rpx 32rpx 24rpx;
  }
</style>
